/*
 *  Copyright (c) M2TK Project. All rights reserved.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package m2tk.assistant.common.domain;

import m2tk.util.BigEndian;

public class StreamDensityBulk
{
    private int id;
    private int pid;
    private int bulkSize;
    private byte[] bulkEncoding;
    private long startPosition;
    private long maxDensity;
    private long minDensity;
    private double avgDensity;

    public final int[] getDensities()
    {
        int[] array = new int[bulkSize];
        for (int i = 0; i < array.length; i ++)
            array[i] = (int) BigEndian.getUINT32(bulkEncoding, i * 4);
        return array;
    }

    public int getId()
    {
        return id;
    }

    public void setId(int id)
    {
        this.id = id;
    }

    public int getPid()
    {
        return pid;
    }

    public void setPid(int pid)
    {
        this.pid = pid;
    }

    public int getBulkSize()
    {
        return bulkSize;
    }

    public void setBulkSize(int bulkSize)
    {
        this.bulkSize = bulkSize;
    }

    public byte[] getBulkEncoding()
    {
        return bulkEncoding;
    }

    public void setBulkEncoding(byte[] bulkEncoding)
    {
        this.bulkEncoding = bulkEncoding;
    }

    public long getStartPosition()
    {
        return startPosition;
    }

    public void setStartPosition(long startPosition)
    {
        this.startPosition = startPosition;
    }

    public long getMaxDensity()
    {
        return maxDensity;
    }

    public void setMaxDensity(long maxDensity)
    {
        this.maxDensity = maxDensity;
    }

    public long getMinDensity()
    {
        return minDensity;
    }

    public void setMinDensity(long minDensity)
    {
        this.minDensity = minDensity;
    }

    public double getAvgDensity()
    {
        return avgDensity;
    }

    public void setAvgDensity(double avgDensity)
    {
        this.avgDensity = avgDensity;
    }
}
